import asyncio
import time

now = lambda: time.time()


async def do_work(x):
    print("Waiting: ", x)


start = now()
# 创建协程对象
coroutine = do_work(2)

# 执行
# 执行一
loop = asyncio.get_event_loop()
# 创建一个 task
# task = loop.create_task(coroutine)
# loop.run_until_complete(task)
# loop.close()

# 执行二
asyncio.run(coroutine)

print("TIME: ", now() - start)
